#set(tableComment = table.tableComment)
#set(entityClass = table.entityClass())
#set(entityProxyClass = table.entityProxyClass())
#set(searchReqVoClass = table.searchReqVoClass())
package #(basePackage).#(table.moduleType).#(table.moduleName).#(table.domainName).controller.#(sceneEnum.basePackage).vo.#(table.businessName);

import com.easy.query.core.expression.lambda.SQLActionExpression1;

import com.goldsyear.dolphin.framework.module.web.core.model.SortParam;
import #(basePackage).#(table.moduleType).#(table.moduleName).#(table.domainName).entity.proxy.#(entityProxyClass);

import lombok.*;
import java.util.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
#for(column : columns)
#if(column.javaType == "BigDecimal")
import java.math.BigDecimal;
#break
#end
#end

### 处理 LocalDateTime 字段的引入
#for(column : columns)
#if(column.listOperation && column.javaType == "LocalDateTime")
import java.time.LocalDateTime;
#break
#end
#end

### 字段模板
#define columnTpl(prefix, prefixStr)
    @ApiModelProperty(value = "#(prefixStr)#(column.columnComment)" #if(column.example != ""), example = "#(column.example)"#end)
    private #(column.javaType) #if(prefix != "") #(prefix)#(JavaField)#else #(column.javaField)#end;
#end

/**
 * @author "#(table.author)"
 */
@ApiModel(value = "#(sceneEnum.name) - #(table.classComment) Request VO")
@Data
public class #(sceneEnum.prefixClass)#(searchReqVoClass) extends SortParam {

#for(column : columns)
#if(column.listOperation) ### 查询操作
#if(column.listOperationCondition == "BETWEEN")### 情况一，Between 的时候
    @ApiModelProperty(value = "#(column.columnComment)"#if(column.example != ""), example = "#(column.example)"#end)
    private #(column.javaType)[] #(column.javaField);
#else ### 情况二，非 Between 的时间
    #@columnTpl('', '')
#end

#end
#end

  @Override
  public SQLActionExpression1<#(entityProxyClass)> buildQuery() {
    return proxy -> {
      #for(column : columns)
      #if(column.listOperation) ### 查询操作
        #if(column.listOperationCondition == "BETWEEN")### 情况一，Between 的时候
        if (#(column.javaField) != null && #(column.javaField).length > 1) {
            proxy.#(column.javaField)().rangeClosedOpen(#(column.javaField)[0], #(column.javaField)[1]);
        }
        #else if(column.listOperationCondition == 'LIKE')
        proxy.#(column.javaField)().like(#(column.javaField));
        #else
        proxy.#(column.javaField)().eq(#(column.javaField));
        #end
      #end
      #end
      };
  }
}